import os
from Api_test.api.base_api import BaseApi

order_id = 0
class Login(BaseApi):

    # path = 'E:/daofeng_api/pytest-allure-api-test/Api_test/data/data.yaml'
    path = os.path.dirname(os.path.dirname(__file__)) + '/data/data.yaml'

    @classmethod
    def chat_top_list(cls, token):
        r = cls.template(po_path=cls.path, key='ChatTopList', token=token)
        return r

    @classmethod
    def bind_code(cls, token):
        r = cls.template(po_path=cls.path, key='BindCode', token=token)
        return r
    @classmethod
    def ServiceItem(cls, token):
        r = cls.template(po_path=cls.path, key='ServiceItem', token=token)
        return r

    @classmethod
    def GetList(cls, token):
        r = cls.template(po_path=cls.path, key='GetList', token=token)
        return r

    @classmethod
    def SubmitOrder(cls, token):
        global order_id
        r = cls.template(po_path=cls.path, key='SubmitOrder', token=token)
        print('api file ', r)
        order_id = r['data']["order_id"]
        return r

    @classmethod
    def CancelOrder(cls, token):
        r = cls.template(po_path=cls.path, key='CancelOrder', token=token)
        return r

    @classmethod
    def GetPeiwanListFilterConfig(cls, token):
        r = cls.template(po_path=cls.path, key='GetPeiwanListFilterConfig', token=token)
        return r





